package com.example.mykotlin.model.entity

import com.example.mykotlin.base.valid.Insert
import com.example.mykotlin.base.valid.Update
import com.mybatisflex.annotation.Id
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.Size

@Schema(name = "ApiPermission", title = "接口权限资源表")
open class ApiPermission(
    @Schema(title = "接口权限资源的唯一标识符")
    @field:Size(max = 32, message = "长度不能超过32")
    @Id
    @field:NotBlank(message = "不能为空", groups = [Update::class])
    var id: String? = null,

    @Schema(title = "接口的名称或描述")
    @field:Size(max = 255, message = "长度不能超过255")
    @field:NotBlank(message = "不能为空", groups = [Insert::class])
    var name: String? = null,

    @Schema(title = "接口的URI路径")
    @field:Size(max = 500, message = "长度不能超过500")
    @field:NotBlank(message = "不能为空", groups = [Insert::class])
    var uriPath: String? = null,

    @Schema(title = "HTTP请求方法")
    var method: String? = null,

    @Schema(title = "接口的详细描述或功能说明")
    @field:Size(max = 500, message = "长度不能超过500")
    var description: String? = null,
)